; This script shows how to use the COM Automation object support.
[Setup]
AppName=My Program
AppVerName=My Program version 1.5
CreateAppDir=no
DisableProgramGroupPage=yes
DefaultGroupName=My Program
UninstallDisplayIcon={app}\MyProg.exe
OutputDir=userdocs:Inno Setup Examples Output
[Code]
{--- SQLDMO ---}
const
SQLServerName = 'localhost';
SQLDMOGrowth_MB = 0;
procedure SQLDMOButtonOnClick(Sender: TObject);
var
SQLServer, Database, DBFile, LogFile: Variant;
IDColumn, NameColumn, Table: Variant;
begin
if MsgBox('Setup will now connect to Microsoft SQL Server ''' + SQLServerName + ''' via a trusted connection and create a database. Do you want to continue?', mbInformation, mb_YesNo) = idNo then
Exit;
{ Create the main SQLDMO COM Automation object }
try
SQLServer := CreateOleObject('SQLDMO.SQLServer');
except
RaiseException('Please install Microsoft SQL server connectivity tools first.'#13#13'(Error ''' + GetExceptionMessage + ''' occurred)');
end;
{ Connect to the Microsoft SQL Server }
SQLServer.LoginSecure := True;
SQLServer.Connect(SQLServerName);
MsgBox('Connected to Microsoft SQL Server ''' + SQLServerName + '''.', mbInformation, mb_Ok);
if MsgBox('Setup will now connect to Microsoft IIS Server ''' + IISServerName + ''' and create a virtual directory. Do you want to continue?', mbInformation, mb_YesNo) = idNo then
if MsgBox('Setup will now use MSXML to download XML file ''' + XMLURL + ''' and save it to disk.'#13#13'Setup will then load, modify and save this XML file. Do you want to continue?', mbInformation, mb_YesNo) = idNo then